package ysq.xyg.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import ysq.xyg.dao.FlowRecordDao;
import ysq.xyg.model.FlowRecord;
import ysq.xyg.service.FlowRecordService;

import javax.annotation.Resource;
import java.util.List;

/**
 * 流量购买记录
 *
 * @author congcong tao
 * @date 2018/9/5 13:38
 */
@Service("flowRecordService")
public class FlowRecordServiceImpl extends BaseServiceImpl<FlowRecord> implements FlowRecordService {

    @Resource
    private FlowRecordDao flowRecordDao;
    @Autowired
    public void setFlowRecordDao(FlowRecordDao flowRecordDao) {
        this.baseDao = flowRecordDao;
    }

    @Override
    public PageInfo<FlowRecord> pageInfo(FlowRecord flowRecord, int pageSize, int pageNum) {
        PageHelper.startPage(pageNum, pageSize);
        List<FlowRecord> list = flowRecordDao.selectEntity(flowRecord);
        return new PageInfo<FlowRecord>(list);
    }
}
